3.1.42 \(\int \cos ^2(c+d x) (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [42]

Optimal. Leaf size=15 \[ C x+\frac {B \sin (c+d x)}{d} \]

[Out]

C*x+B*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {4132, 2717, 8} \begin {gather*} \frac {B \sin (c+d x)}{d}+C x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

C*x + (B*Sin[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 4132

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(
C_.)), x_Symbol] :> Dist[B/b, Int[(b*Csc[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x
]^2), x] /; FreeQ[{b, e, f, A, B, C, m}, x]

Rubi steps

\begin {align*} \int \cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=B \int \cos (c+d x) \, dx+\int C \, dx\\ &=C x+\frac {B \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 26, normalized size = 1.73 \begin {gather*} C x+\frac {B \cos (d x) \sin (c)}{d}+\frac {B \cos (c) \sin (d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

C*x + (B*Cos[d*x]*Sin[c])/d + (B*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]
time = 0.28, size = 21, normalized size = 1.40

method result size
risch \(C x +\frac {B \sin \left (d x +c \right )}{d}\) \(16\)
derivativedivides \(\frac {B \sin \left (d x +c \right )+C \left (d x +c \right )}{d}\) \(21\)
default \(\frac {B \sin \left (d x +c \right )+C \left (d x +c \right )}{d}\) \(21\)
norman \(\frac {C x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+C x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-C x -\frac {2 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-C x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(112\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(B*sin(d*x+c)+C*(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 20, normalized size = 1.33 \begin {gather*} \frac {{\left (d x + c\right )} C + B \sin \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

((d*x + c)*C + B*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 2.92, size = 17, normalized size = 1.13 \begin {gather*} \frac {C d x + B \sin \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

(C*d*x + B*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (B + C \sec {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(B*sec(d*x+c)+C*sec(d*x+c)**2),x)

[Out]

Integral((B + C*sec(c + d*x))*cos(c + d*x)**2*sec(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (15) = 30\).
time = 0.46, size = 39, normalized size = 2.60 \begin {gather*} \frac {{\left (d x + c\right )} C + \frac {2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

((d*x + c)*C + 2*B*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d

________________________________________________________________________________________

Mupad [B]
time = 2.41, size = 17, normalized size = 1.13 \begin {gather*} \frac {B\,\sin \left (c+d\,x\right )+C\,d\,x}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2*(B/cos(c + d*x) + C/cos(c + d*x)^2),x)

[Out]

(B*sin(c + d*x) + C*d*x)/d

________________________________________________________________________________________